package com.pe.pgn.clubpgn.domain;

import java.util.Calendar;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.Type;
import org.springframework.format.annotation.DateTimeFormat;

@Entity
@Table(name = "clpm_reserva_mov_stock")
public class ClpmReservaMovStock extends CamposAuditoria{

	private static final long serialVersionUID = 4672344455706552131L;
	private Long id;
	private ClpbDocumentoMovArticulo clpbDocumento;
	private boolean stReservaMovStock;
	
	@Id
	@Column(name="id")
    @SequenceGenerator(name="seqreservamovstock", sequenceName="seq_reserva_mov_stock")
    @GeneratedValue(generator="seqreservamovstock")	
	public Long getId() {
		return id;
	}

	@ManyToOne(targetEntity = ClpbDocumentoMovArticulo.class)
    @JoinColumn(name="co_documento_mov_articulo")
	public ClpbDocumentoMovArticulo getClpbDocumento() {
		return clpbDocumento;
	}
	
	@Column(name = "st_reserva_mov_stock")
	@Type(type = "yes_no")
	public boolean isStReservaMovStock() {
		return stReservaMovStock;
	}
	
	@Column(name = "co_usuario_creador", updatable = false, nullable = false, length = 30)
	public String getCoUsuarioCreador() {
		return coUsuarioCreador;
	}

    @Column(name = "da_fecha_creacion", updatable = false, nullable = false)
    @Temporal(TemporalType.TIMESTAMP)
    @DateTimeFormat(style = "S-")
	public Calendar getDaFechaCreacion() {
		return daFechaCreacion;
	}

	@Column(name = "co_usuario_modificador", length = 30)
	public String getCoUsuarioModificador() {
		return coUsuarioModificador;
	}

    @Column(name = "da_fecha_modificacion")
    @Temporal(TemporalType.TIMESTAMP)
    @DateTimeFormat(style = "S-")
	public Calendar getDaFechaModificacion() {
		return daFechaModificacion;
	}
	
	public void setId(Long id) {
		this.id = id;
	}

	public void setClpbDocumento(ClpbDocumentoMovArticulo clpbDocumento) {
		this.clpbDocumento = clpbDocumento;
	}

	public void setStReservaMovStock(boolean stReservaMovStock) {
		this.stReservaMovStock = stReservaMovStock;
	}

	@Override
	public boolean equals(Object o) {
		return false;
	}

	@Override
	public int hashCode() {
		return 0;
	}

	@Override
	public String toString() {
		return null;
	}
}
